﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cache.FileCache;
using Cache.MemoryCache;

namespace Cache
{
    public class CacheFactory
    {
        public static ICache CreateCache(CacheType cacheType)
        {
            switch (cacheType)
            {
                case CacheType.File:
                    return FileCacheClient.GetInstance();
                case CacheType.Memory:
                    return MemoryCacheClient.GetInstance();
                case CacheType.MemCache:
                case CacheType.Redis:
                default:
                    throw new NotSupportedException();
            }
        }
    }
}
